
const util = require('util');

function tokenKey(token){
	return util.format("security.token.%s", token);
}

function insightThumbKey(uid){
	return util.format('app.insight.%s.thumb', uid);
}

/**
 * 获取数据的 redis key
 * @param string uid 数据 uid
 */
function genPublicDataKey(uid) {
	return util.format('cache.publicdata.%s', uid);
}

/**
 * 获取数据的 redis key
 * @param string uid 数据 uid
 */
function genUserDataKey(uid) {
	return util.format('cache.userdata.%s', uid);
}

exports.tokenKey = tokenKey;
exports.insightThumbKey = insightThumbKey;
exports.genPublicDataKey = genPublicDataKey;
exports.genUserDataKey = genUserDataKey;
